//
//  HelperTableViewCell.m
//  CarWorld
//
//  Created by 李东方 on 15/3/28.
//  Copyright (c) 2015年 CarWorldTeam. All rights reserved.
//

#import "HelperTableViewCell.h"

@implementation HelperTableViewCell

- (void)dealloc
{
    [_iconImageview release];
    [_titleLable release];
    [_infoLable release];
    [_textLable release];
    [_helper release];
    [super dealloc];
}

//重写
-(void)setHelper:(HelperModel *)helper
{
    if (_helper != helper)
    {
        [_helper release];
        _helper = [helper retain];
        //赋值
        _titleLable.text = helper.title;
        _infoLable.text = helper.info;
        _textLable.text = helper.text;
        if (helper.photo == nil)
        {
            _iconImageview.image = [UIImage imageNamed:@"item4_u"];
        }
        else
        {
            _iconImageview.image = helper.photo;
        }
    }
}

//重写初始化方法
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        //图片位置
        _iconImageview = [[UIImageView alloc] initWithFrame:CGRectMake(20, 20, 60, 70)];
        [self.contentView addSubview:_iconImageview];
        
        //指数位置
        _titleLable = [[UILabel alloc] initWithFrame:CGRectMake(80, 20, 100, 30)];
        [self.contentView addSubview:_titleLable];
        
        //指数text位置
        _textLable = [[UILabel alloc] initWithFrame:CGRectMake(200, 20, 100, 30)];
        [self.contentView addSubview:_textLable];
        
        //建议位置
        _infoLable = [[UILabel alloc] initWithFrame:CGRectMake(80, 50, 230, 60)];
        _infoLable.numberOfLines = 2;//多行显示
        [self.contentView addSubview:_infoLable];
    }
    return self;
}





















- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
